/*
 * OledTestCase.h
 *
 *  Created on: 2021年9月1日
 *      Author: vicent-PC
 */

#ifndef HAL_DisplayCanvas_H_
#define HAL_DisplayCanvas_H_

#include "oled/ESP8266_and_ESP32_OLED_driver_for_SSD1306_displays/src/OLEDDisplay.h"

class DisplayCanvas {
   public:
    DisplayCanvas();
    virtual ~DisplayCanvas();
    static DisplayCanvas* getInstance() {
        if (m_pInstance == nullptr) m_pInstance = new DisplayCanvas();
        return m_pInstance;
    }

    // extern interface
    int init();
    int deInit();
    int drawBmp(uint16_t x, uint16_t y, uint16_t w, uint16_t h,
                uint16_t* bitmap);
    void testWelcome();
    OLEDDisplay* getPen() { return mpDisplay; }

   private:
    OLEDDisplay* mpDisplay = nullptr;

   public:
    static DisplayCanvas* m_pInstance;
};

#endif /* HAL_DRIVER_SCREEN_HAL_OLEDTESTCASE_H_ */
